package com.ctshk.rpc.order.custom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.order.custom.entity.CustomizedOrderReceiptInsurance;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 保单收据 Mapper 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-03-05
 */
public interface CustomizedOrderReceiptInsuranceMapper extends BaseMapper<CustomizedOrderReceiptInsurance> {

    /**
     * 团期保单收据作废
     * @param schedule
     * @param userId
     * @return
     */
    @Update("UPDATE t_customized_order_receipt_insurance\n" +
            "SET modified_id = #{user_id},is_deleted = 1\n" +
            "WHERE schedule_id = #{schedule_id} AND is_deleted = 0")
    Integer delBySchedule(@Param("schedule_id") Long schedule, @Param("user_id") Long userId);
}
